package com.hmkj.core.mapper.marketing;

import com.hmkj.common.baseMapper.GenericMapper;
import com.hmkj.core.po.marketing.UserEarningsRanking;
import org.apache.ibatis.annotations.Select;

import java.util.List;
import java.util.Map;

/**
 * 用户盈利排行榜相关Dao接口<br>
 *
 * @author eproo
 * @date 2018-07-07 03:11:59
 */
public interface UserEarningsRankingMapper extends GenericMapper<UserEarningsRanking, Integer> {
    /**
     * 用户盈利排行榜
     *
     * @return
     */
    @Select("SELECT * FROM s_user_earnings_ranking WHERE 1=1  order by profit desc")
    List<UserEarningsRanking> findUserRankingData();


    @Select("SELECT t.* FROM s_user_earnings_ranking t WHERE 1=1 ${whereSql} ${sortSql} limit ${nowPage}, ${pageSize} ")
    List<UserEarningsRanking> findListBySqlJoin(Map<String, Object> params);

    @Select("SELECT count(1) FROM s_user_earnings_ranking t WHERE 1=1 ${whereSql}")
    long countBySqlJoin(Map<String, Object> params);

}
